.class public final Llt/farmis/libraries/externalgps/ExternalGPS;
.super Ljava/lang/Object;
.source "ExternalGPS.kt"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Llt/farmis/libraries/externalgps/ExternalGPS$Companion;
    }
.end annotation

.annotation system Ldalvik/annotation/SourceDebugExtension;
    value = "SMAP\nExternalGPS.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ExternalGPS.kt\nlt/farmis/libraries/externalgps/ExternalGPS\n+ 2 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,188:1\n1497#2,2:189\n1497#2,2:191\n*E\n*S KotlinDebug\n*F\n+ 1 ExternalGPS.kt\nlt/farmis/libraries/externalgps/ExternalGPS\n*L\n108#1,2:189\n115#1,2:191\n*E\n"
.end annotation


# static fields
.field public static final Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

.field private static final instance:Llt/farmis/libraries/externalgps/ExternalGPS;


# instance fields
.field private gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

.field private final locationListenerDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;

.field private final locationListeners:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;",
            ">;"
        }
    .end annotation
.end field

.field private samplingRate:D

.field private final statusChangeDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;

.field private final statusListeners:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 2

    new-instance v0, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V

    sput-object v0, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    .line 24
    new-instance v0, Llt/farmis/libraries/externalgps/ExternalGPS;

    invoke-direct {v0}, Llt/farmis/libraries/externalgps/ExternalGPS;-><init>()V

    sput-object v0, Llt/farmis/libraries/externalgps/ExternalGPS;->instance:Llt/farmis/libraries/externalgps/ExternalGPS;

    return-void
.end method

.method public constructor <init>()V
    .locals 2

    .line 17
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const-wide/high16 v0, 0x4008000000000000L    # 3.0

    .line 21
    iput-wide v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->samplingRate:D

    .line 27
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->statusListeners:Ljava/util/List;

    .line 29
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->locationListeners:Ljava/util/List;

    .line 31
    new-instance v0, Llt/farmis/libraries/externalgps/ExternalGPS$statusChangeDelegate$1;

    invoke-direct {v0, p0}, Llt/farmis/libraries/externalgps/ExternalGPS$statusChangeDelegate$1;-><init>(Llt/farmis/libraries/externalgps/ExternalGPS;)V

    iput-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->statusChangeDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;

    .line 37
    new-instance v0, Llt/farmis/libraries/externalgps/ExternalGPS$locationListenerDelegate$1;

    invoke-direct {v0, p0}, Llt/farmis/libraries/externalgps/ExternalGPS$locationListenerDelegate$1;-><init>(Llt/farmis/libraries/externalgps/ExternalGPS;)V

    iput-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->locationListenerDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;

    return-void
.end method

.method public static final synthetic access$getInstance$cp()Llt/farmis/libraries/externalgps/ExternalGPS;
    .locals 1

    .line 17
    sget-object v0, Llt/farmis/libraries/externalgps/ExternalGPS;->instance:Llt/farmis/libraries/externalgps/ExternalGPS;

    return-object v0
.end method


# virtual methods
.method public final disconnect()V
    .locals 1

    .line 168
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz v0, :cond_0

    .line 169
    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->disconnect()V

    :cond_0
    return-void
.end method

.method public final getBaudRateList()Ljava/util/List;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/utils/NamedInt;",
            ">;"
        }
    .end annotation

    const/16 v0, 0xe

    .line 47
    new-array v0, v0, [Llt/farmis/libraries/externalgps/utils/NamedInt;

    .line 48
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "110"

    const/16 v3, 0x6e

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x0

    aput-object v1, v0, v2

    .line 49
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "300"

    const/16 v3, 0x12c

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x1

    aput-object v1, v0, v2

    .line 50
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "600"

    const/16 v3, 0x258

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x2

    aput-object v1, v0, v2

    .line 51
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "1200"

    const/16 v3, 0x4b0

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x3

    aput-object v1, v0, v2

    .line 52
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "2400"

    const/16 v3, 0x960

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x4

    aput-object v1, v0, v2

    .line 53
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "4800"

    const/16 v3, 0x12c0

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x5

    aput-object v1, v0, v2

    .line 54
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "9600"

    const/16 v3, 0x2580

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x6

    aput-object v1, v0, v2

    .line 55
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "14400"

    const/16 v3, 0x3840

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x7

    aput-object v1, v0, v2

    .line 56
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "19200"

    const/16 v3, 0x4b00

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/16 v2, 0x8

    aput-object v1, v0, v2

    .line 57
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "38400"

    const v3, 0x9600

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/16 v2, 0x9

    aput-object v1, v0, v2

    .line 58
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "57600"

    const v3, 0xe100

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/16 v2, 0xa

    aput-object v1, v0, v2

    .line 59
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "115200"

    const v3, 0x1c200

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/16 v2, 0xb

    aput-object v1, v0, v2

    .line 60
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "128000"

    const v3, 0x1f400

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/16 v2, 0xc

    aput-object v1, v0, v2

    .line 61
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "256000"

    const v3, 0x3e800

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/16 v2, 0xd

    aput-object v1, v0, v2

    .line 47
    invoke-static {v0}, Lkotlin/collections/CollectionsKt;->mutableListOf([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public final getDataBitsList()Ljava/util/List;
    .locals 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/utils/NamedInt;",
            ">;"
        }
    .end annotation

    const/4 v0, 0x4

    .line 66
    new-array v0, v0, [Llt/farmis/libraries/externalgps/utils/NamedInt;

    .line 67
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "DATA_BITS_5"

    const/4 v3, 0x5

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x0

    aput-object v1, v0, v2

    .line 68
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "DATA_BITS_6"

    const/4 v3, 0x6

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x1

    aput-object v1, v0, v2

    .line 69
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "DATA_BITS_7"

    const/4 v3, 0x7

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x2

    aput-object v1, v0, v2

    .line 70
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "DATA_BITS_8"

    const/16 v3, 0x8

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v2, 0x3

    aput-object v1, v0, v2

    .line 66
    invoke-static {v0}, Lkotlin/collections/CollectionsKt;->mutableListOf([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public final getExternalGPSState()Llt/farmis/libraries/externalgps/providers/Status;
    .locals 1

    .line 101
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->getMDeviceProvider()Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    if-eqz v0, :cond_0

    goto :goto_0

    :cond_0
    sget-object v0, Llt/farmis/libraries/externalgps/providers/Status;->INDETERMINE:Llt/farmis/libraries/externalgps/providers/Status;

    :goto_0
    return-object v0
.end method

.method public final getFlowControlList()Ljava/util/List;
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/utils/NamedInt;",
            ">;"
        }
    .end annotation

    const/4 v0, 0x4

    .line 90
    new-array v0, v0, [Llt/farmis/libraries/externalgps/utils/NamedInt;

    .line 91
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v2, 0x0

    const-string v3, "FLOW_CONTROL_OFF"

    invoke-direct {v1, v3, v2}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v2

    .line 92
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v2, 0x2

    const-string v3, "FLOW_CONTROL_DSR_DTR"

    invoke-direct {v1, v3, v2}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v3, 0x1

    aput-object v1, v0, v3

    .line 93
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v4, "FLOW_CONTROL_RTS_CTS"

    invoke-direct {v1, v4, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v2

    .line 94
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v2, 0x3

    const-string v3, "FLOW_CONTROL_XON_XOFF"

    invoke-direct {v1, v3, v2}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v2

    .line 90
    invoke-static {v0}, Lkotlin/collections/CollectionsKt;->mutableListOf([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public final getGpsThread()Llt/farmis/libraries/externalgps/ExternalGPSThread;
    .locals 1

    .line 19
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    return-object v0
.end method

.method public final getLocationListeners()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;",
            ">;"
        }
    .end annotation

    .line 29
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->locationListeners:Ljava/util/List;

    return-object v0
.end method

.method public final getParitiesList()Ljava/util/List;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/utils/NamedInt;",
            ">;"
        }
    .end annotation

    const/4 v0, 0x5

    .line 81
    new-array v0, v0, [Llt/farmis/libraries/externalgps/utils/NamedInt;

    .line 82
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v2, 0x0

    const-string v3, "PARITY_NONE"

    invoke-direct {v1, v3, v2}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v2

    .line 83
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v2, 0x2

    const-string v3, "PARITY_EVEN"

    invoke-direct {v1, v3, v2}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v3, 0x1

    aput-object v1, v0, v3

    .line 84
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v4, 0x3

    const-string v5, "PARITY_MARK"

    invoke-direct {v1, v5, v4}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v2

    .line 85
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v2, "PARITY_ODD"

    invoke-direct {v1, v2, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v4

    .line 86
    new-instance v1, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v2, 0x4

    const-string v3, "PARITY_SPACE"

    invoke-direct {v1, v3, v2}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v1, v0, v2

    .line 81
    invoke-static {v0}, Lkotlin/collections/CollectionsKt;->mutableListOf([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public final getStatusListeners()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;",
            ">;"
        }
    .end annotation

    .line 27
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->statusListeners:Ljava/util/List;

    return-object v0
.end method

.method public final getStopBitsList()Ljava/util/List;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/farmis/libraries/externalgps/utils/NamedInt;",
            ">;"
        }
    .end annotation

    const/4 v0, 0x3

    .line 74
    new-array v1, v0, [Llt/farmis/libraries/externalgps/utils/NamedInt;

    .line 75
    new-instance v2, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v3, 0x1

    const-string v4, "STOP_BITS_1"

    invoke-direct {v2, v4, v3}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    const/4 v4, 0x0

    aput-object v2, v1, v4

    .line 76
    new-instance v2, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const/4 v4, 0x2

    const-string v5, "STOP_BITS_2"

    invoke-direct {v2, v5, v4}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v2, v1, v3

    .line 77
    new-instance v2, Llt/farmis/libraries/externalgps/utils/NamedInt;

    const-string v3, "STOP_BITS_15"

    invoke-direct {v2, v3, v0}, Llt/farmis/libraries/externalgps/utils/NamedInt;-><init>(Ljava/lang/String;I)V

    aput-object v2, v1, v4

    .line 74
    invoke-static {v1}, Lkotlin/collections/CollectionsKt;->mutableListOf([Ljava/lang/Object;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public onLocationChanged(Llt/farmis/libraries/externalgps/GPSLocation;)V
    .locals 2

    const-string v0, "location"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 115
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->locationListeners:Ljava/util/List;

    .line 191
    invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;

    .line 115
    invoke-interface {v1, p1}, Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;->onLocationUpdate(Llt/farmis/libraries/externalgps/GPSLocation;)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public onStatusChanged(Llt/farmis/libraries/externalgps/providers/Status;)V
    .locals 2

    const-string v0, "status"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 108
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->statusListeners:Ljava/util/List;

    .line 189
    invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;

    .line 108
    invoke-interface {v1, p1}, Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;->onStatusChanged(Llt/farmis/libraries/externalgps/providers/Status;)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public final setSamplingRate(D)V
    .locals 3

    const-wide v0, 0x3e7ad7f29abcaf48L    # 1.0E-7

    cmpg-double v2, p1, v0

    if-lez v2, :cond_1

    .line 184
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz v0, :cond_0

    const/16 v1, 0x3e8

    int-to-double v1, v1

    invoke-static {v1, v2}, Ljava/lang/Double;->isNaN(D)Z

    div-double/2addr v1, p1

    invoke-static {v1, v2}, Lkotlin/math/MathKt;->roundToLong(D)J

    move-result-wide v1

    invoke-virtual {v0, v1, v2}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->setSleepInterval(J)V

    .line 185
    :cond_0
    iput-wide p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->samplingRate:D

    return-void

    .line 182
    :cond_1
    new-instance p1, Ljava/lang/IllegalArgumentException;

    const-string p2, "negative or near zero sampling rate is unacceptable"

    invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V

    throw p1
.end method

.method public final startBluetoothExternalGPS(Landroid/bluetooth/BluetoothDevice;Llt/farmis/libraries/externalgps/nmea/NmeaParser;)V
    .locals 3

    const-string v0, "device"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "nmeaParser"

    invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 131
    monitor-enter p0

    .line 132
    :try_start_0
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->getMDeviceProvider()Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    goto :goto_0

    :cond_0
    move-object v0, v1

    :goto_0
    sget-object v2, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_5

    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->getMDeviceProvider()Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    goto :goto_1

    :cond_1
    move-object v0, v1

    :goto_1
    sget-object v2, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTING:Llt/farmis/libraries/externalgps/providers/Status;

    invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_5

    .line 135
    new-instance v0, Llt/farmis/libraries/externalgps/ExternalGPSThread;

    new-instance v2, Llt/farmis/libraries/externalgps/providers/bluetooth/NmeaBluetoothDevice;

    invoke-direct {v2, p1}, Llt/farmis/libraries/externalgps/providers/bluetooth/NmeaBluetoothDevice;-><init>(Landroid/bluetooth/BluetoothDevice;)V

    invoke-direct {v0, v2, p2}, Llt/farmis/libraries/externalgps/ExternalGPSThread;-><init>(Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;Llt/farmis/libraries/externalgps/nmea/NmeaParser;)V

    iput-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    .line 136
    iget-object p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz p1, :cond_4

    iget-object p2, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->locationListenerDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;

    invoke-virtual {p1, p2}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->setLocationUpdateListener(Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;)V

    .line 137
    iget-object p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz p1, :cond_3

    iget-object p2, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->statusChangeDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;

    invoke-virtual {p1, p2}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->setStatusListener(Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;)V

    .line 138
    iget-object p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz p1, :cond_2

    invoke-virtual {p1}, Ljava/lang/Thread;->start()V

    .line 139
    sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 131
    monitor-exit p0

    return-void

    .line 138
    :cond_2
    :try_start_1
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1

    .line 137
    :cond_3
    :try_start_2
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw v1

    .line 136
    :cond_4
    :try_start_3
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    throw v1

    .line 133
    :cond_5
    :try_start_4
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string p2, "USB GPS already started"

    invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V

    throw p1
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_0

    :catchall_0
    move-exception p1

    .line 131
    monitor-exit p0

    throw p1
.end method

.method public final startUSBExternalGPS(Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbManager;Llt/farmis/libraries/externalgps/providers/usb/USBDeviceManagerConfigs;Llt/farmis/libraries/externalgps/nmea/NmeaParser;)V
    .locals 3

    const-string v0, "device"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "usbManager"

    invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "configs"

    invoke-static {p3, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "nmeaParser"

    invoke-static {p4, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 119
    monitor-enter p0

    .line 120
    :try_start_0
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->getMDeviceProvider()Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;

    move-result-object v0

    if-eqz v0, :cond_0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    goto :goto_0

    :cond_0
    move-object v0, v1

    :goto_0
    sget-object v2, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-nez v0, :cond_2

    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->getMDeviceProvider()Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;

    move-result-object v0

    if-eqz v0, :cond_1

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    goto :goto_1

    :cond_1
    move-object v0, v1

    :goto_1
    sget-object v2, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTING:Llt/farmis/libraries/externalgps/providers/Status;

    invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_3

    .line 121
    :cond_2
    iget-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz v0, :cond_3

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->disconnect()V

    .line 123
    :cond_3
    new-instance v0, Llt/farmis/libraries/externalgps/ExternalGPSThread;

    new-instance v2, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;

    invoke-direct {v2, p1, p2, p3}, Llt/farmis/libraries/externalgps/providers/usb/NmeaUSBDevice;-><init>(Landroid/hardware/usb/UsbDevice;Landroid/hardware/usb/UsbManager;Llt/farmis/libraries/externalgps/providers/usb/USBDeviceManagerConfigs;)V

    invoke-direct {v0, v2, p4}, Llt/farmis/libraries/externalgps/ExternalGPSThread;-><init>(Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;Llt/farmis/libraries/externalgps/nmea/NmeaParser;)V

    iput-object v0, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    .line 124
    iget-object p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz p1, :cond_6

    iget-object p2, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->locationListenerDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;

    invoke-virtual {p1, p2}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->setLocationUpdateListener(Llt/farmis/libraries/externalgps/ExternalGPSThread$LocationUpdateListener;)V

    .line 125
    iget-object p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz p1, :cond_5

    iget-object p2, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->statusChangeDelegate:Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;

    invoke-virtual {p1, p2}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->setStatusListener(Llt/farmis/libraries/externalgps/ExternalGPSThread$StatusListener;)V

    .line 126
    iget-object p1, p0, Llt/farmis/libraries/externalgps/ExternalGPS;->gpsThread:Llt/farmis/libraries/externalgps/ExternalGPSThread;

    if-eqz p1, :cond_4

    invoke-virtual {p1}, Ljava/lang/Thread;->start()V

    .line 127
    sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 119
    monitor-exit p0

    return-void

    .line 126
    :cond_4
    :try_start_1
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1

    .line 125
    :cond_5
    :try_start_2
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    throw v1

    .line 124
    :cond_6
    :try_start_3
    invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->throwNpe()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    throw v1

    :catchall_0
    move-exception p1

    .line 119
    monitor-exit p0

    throw p1
.end method
